﻿using Core.Model;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;

namespace Core.DataAccess.Tools.Implementations.OverrideMappings
{
    public class UserMapping :IAutoMappingOverride<Core.Model.User>
    {
        #region Implementation of IAutoMappingOverride<User>

        public void Override(AutoMapping<User> mapping)
        {
            mapping.HasMany(x => x.MyQuestionLists).KeyColumn("UserId").Cascade.All();
            mapping.HasMany(x => x.Answers).KeyColumn("UserId").Cascade.All();
        }

        #endregion
    }
}
